package demo;


import java.util.Scanner;

//目标：完成电影信息展示功能；根据电影ID查询电影详情
//电影数据：
//      1,"水门桥",38.9,9.8,"徐克","吴京","12万人想看"
//      2,"出拳吧",39,7.8,"唐晓白","田雨","5万人想看"
//      3,"月球陨落",42,7.9,"罗兰","贝瑞“，”17.9万人想看"
//      4,"一点到家",35,8.7,"徐宏宇","刘昊然","10.8万人想看"
public class Test
{
    public static void main(String[] args)
    {
        //1.设计一个电影类
        //2.设计一个电影的操作
        //3.录入全部电影数据
        Movie[] movies = new Movie[4];
        Movie m1 = new Movie(1,"水门桥",38.9,9.8,"徐克","吴京","12万人想看");
        Movie m2 = new Movie(2,"出拳吧",39,7.8,"唐晓白","田雨","5万人想看");
        Movie m3 = new Movie(3,"月球陨落",42,7.9,"罗兰","贝瑞","17.9万人想看");
        Movie m4 = new Movie(4,"一点到家",35,8.7,"徐宏宇","刘昊然","10.8万人想看");
        movies[0] = m1;
        movies[1] = m2;
        movies[2] = m3;
        movies[3] = m4;
        //4.创建一个电影操作类的对象，接收数据并进行处理
        MovieOperator Operator = new MovieOperator(movies);
        Scanner sc = new Scanner(System.in);
        while (true)
        {
            System.out.println("===电影===");
            System.out.println("1.查询全部电影信息");
            System.out.println("2.根据id查询电影信息");
            System.out.println("请输入编号");
            int command = sc.nextInt();
            switch (command)
            {
                case 1:
                    Operator.PrintAllMovies();
                    break;
                case 2:
                    System.out.println("请输入查询ID");
                    int indx = sc.nextInt();
                    Operator.searchMovieById(indx);
                    break;
                default:
                    System.out.println("您的编号有问题");
            }
        }
    }
}
